package com.jxk.userserver.controller;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

/**
 * @ClassName : HelloController  //类名
 * @Description :   //描述
 * @Author : jxk  //作者
 * @Date: 2020-09-23 16:21  //时间
 */
@CrossOrigin(value = "*")
@RestController
public class HelloController {
    @GetMapping("/hello")
    public String hello() {
        return "hello";
    }
    @GetMapping("/admin/hello")
    public String admin() {
        return "admin";
    }
    @RestController
    public class UserController {
        @GetMapping("/user")
        public Principal getCurrentUser(Principal principal) {
            return principal;
        }
    }
}